Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#306: Add support for newer jakarta.servlet.http API into JsonRpcServer #308

Merged
merged 4 commits into from
May 24, 2023

Conversation

cyb3r4nt
Copy link
Contributor

#306: Add support for newer jakarta.servlet.http API into JsonRpcServer

Added an additional method, which accepts jakarta.servlet.http.HttpServletRequest and jakarta.servlet.http.HttpServletResponse as parameters.
Extracted common interfaces for javax and jakarta variants.

Now this can be used in the newer servlet containers and can also work with Spring Framework 6.

The drawback is that all users need to include jakarta.servlet:jakarta.servlet-api into their classpath.

…inside JsonRpcServer

Common logic may be used to handle the HTTP requests.
This is a preparation for using jakarta.servlet.http namespace objects.
There are no much requirements for those interfaces,
only some common methods, which are present in most

Portlet API requests were not changed, because there is a comment,
which assumes that HTTP status code is assigned outside.
Added a TODO comment there with possible solution proposal.


Signed-off-by: cyb3r4nt <[email protected]>
…into JsonRpcServer

Both javax and jakarta objects/APIs have similar method signatures and differ only with types.
Two new classes were added to adapt to the common interface.

Not very last version of jakarta.servlet-api v5.0.0 was added,
because project JDK target is Java 8.
jakarta.servlet-api v5.0.0 comes from the Jakarta EE 9,
which is still compatible with JDK 8.


Signed-off-by: cyb3r4nt <[email protected]>
…onRpcServer

Removed @SuppressWarnings from top-level place on top of the class.
Currently only two handle() methods are shown as unused,
but these are public API methods, which meant to be called by the clients.


Signed-off-by: cyb3r4nt <[email protected]>
@Amberize
Copy link

Amberize commented Feb 1, 2023

@briandilley do you have any concerns on this PR? Otherwise could I help @cyb3r4nt to improve the PR in order to push it to release?

@manoj398
Copy link

WEB_PARAM_ANNOTATION_CLASS_LOADER is hard coded to use javax.

@nixel2007
Copy link

Any info about this? wanna try it with spring 6

@cyb3r4nt
Copy link
Contributor Author

cyb3r4nt commented Mar 1, 2023

Yeah, newer jakarta.jws.WebParam annotation support is missing here.
Will try to investigate this.

@briandilley briandilley merged commit 05ce039 into briandilley:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants